<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>{$site.title}</title>
    <link rel="stylesheet" href="__STATIC__/index/layui/css/layui.css"/>
    <link rel="stylesheet" href="__STATIC__/index/css/main.css"/>
</head>
<body class="page-no-scroll">
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>
<!-- header -->
<div class="ew-header">
    <img class="layui-logo" {if condition="$site.logo eq ''"} src="__STATIC__/index/images/un28.svg"{else} src="{$site.logo}" {/if} style="height:50px;padding: 10px;" />
    <div class="ew-nav-group">
        <div class="nav-toggle"><i class="layui-icon layui-icon-more-vertical"></i></div>
        <ul class="layui-nav" lay-filter="ew-header-nav">
            <li class="layui-nav-item">
                <a lay-href="/">首页</a>
            </li>
            <li class="layui-nav-item">
                <a href="/admin.php" target="_blank">后台</a>
            </li>
        </ul>
    </div>
</div>

<!-- goods-card -->
<div class="layui-container body-card">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">
            <div class="layui-card">
                <div class="layui-card-header">
                    <span class="layui-breadcrumb">
                        <a href="/index.html">首页</a>
                        <a><cite>邮件发送</cite></a>
                    </span>
                </div>
                <div class="layui-card-body goods-desc-card">
                    <div class="layui-card-body goods-desc-card">
                        <div style="text-align: center;margin: 15px 0 25px 0;">
                         <span style="padding: 10px 15px;border-top: 2px solid #3EC483;border-bottom: 2px solid #3EC483;display: inline-block;font-size: 16px;color: #555;"> 邮箱发送</span>
                        </div>
                        <div>
                         <table class="layui-table">
                          <colgroup>
                           <col width="120px" />
                           <col />
                          </colgroup>
                          <tbody>
                           <tr>
                            <th style="background-color: #F4F7F7;color: #333;text-align: right;">调用方法</th>
                            <td>(new \app\common\service\MailService)->go('地址','标题','内容')</td>
                           </tr>
                           <tr>
                            <th style="background-color: #F4F7F7;color: #333;text-align: right;">注意事项</th>
                            <td> 请确保后台已配置email项。</td>
                           </tr>
                          </tbody>
                         </table>
                        </div>
                       </div>
                </div>
            </div>
        </div>
        <div class="layui-col-md4">
            <div class="layui-card">
                <div class="layui-card-header">功能测试</div>
                <div class="layui-card-body goods-card">
                    <div class="goods-btn-group">
						<a onclick="openShow()" class="layui-btn layui-btn-lg layui-btn-fluid layui-btn-primary">
						    <i class="layui-icon">&#xe617;</i>点击测试
                        </a>
                        <a href="https://gitee.com/pear-admin/Pear-Admin-Think" class="layui-btn layui-btn-lg layui-btn-fluid layui-btn-warm">
                            <i class="layui-icon">&#xe620;</i>前往GITEE
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- footer -->
<div class="ew-footer">
    <div class="layui-container">
        <div class="footer-copyright">
            <p>Copyright © 2021 pear admin think. All rights reserved.</p>
        </div>
    </div>
</div>

<!-- js部分 -->
<script type="text/javascript" src="__STATIC__/index/layui/layui.js"></script>
<script type="text/javascript" src="__STATIC__/index/js/common.js"></script>
<script>
layui.use(['form', 'layer', 'jquery', 'element'], function () {
    var $ = layui.jquery
             , layer = layui.layer
             , element = layui.element
             , form = layui.form;

        window.openShow = function() {
            var html = '';
            html += '<div class="was-validated" style="padding-top:20px;padding-left:10px;padding-right:10px;">';
            html += '<div><input type="text" id="email" required  lay-verify="required" placeholder="请填写收件邮箱" autocomplete="off" class="layui-input"></div>';
            html += '</div> ';
            layer.open({
                    type: 1,
                    title: "邮箱发信测试",
                    area: ["200px", "200px"],
                    closeBtn: 0,
                    content: html
                    , btn: ['提交', '取消']
                    , yes: function (index, layero) {
                        //按钮【按钮一】的回调
                        var resason = $('#email').val();
                        if (resason == null || resason == "") {
                            layer.msg("请填写收件邮箱");
                            return false;
                        }
                        $.ajax({
                            type: "POST",
                            data: {'email':resason},
                            success: function (res) {
                                layer.closeAll('loading');
                                if (res.code==200){
                                    layer.msg(res.msg,{icon:1,time:1500},function () {
                                        layer.close(index);
                                    })
                                } else {
                                    layer.msg(res.msg,{icon:2,time:1500})
                                }
                            }
                        });
                        return false;
                    }
                    , btn2: function (index, layero) {
                        layer.close(index);
                    }
                });
            }
    });
</script>
</body>
</html>